import React, { Component } from 'react'
import { connect } from "react-redux"
import { Button } from 'antd'
import { addTop } from "../../../redux/actions/top"

const mapState = state => ({
    bottom: state.bottom
})
const mapDispatch = {
    addTop
}

class Top extends Component {
    addTopNumber = () => {
        this.props.addTop(1)
    }
    render() {
        return (
            <div>
                下面的组件值是：{this.props.bottom}
                <Button onClick={this.addTopNumber}>点我给下面的组件加1</Button>
            </div>
        )
    }
}
export default connect(mapState, mapDispatch)(Top)
